package com.crm.customers.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.crm.customers.dao.CommissionCustomerDao;
import com.crm.customers.model.CommissionCustomer;
import com.crm.customers.service.CommissionCustomerService;

@Service("commissionCustomerService")
public class CommissionCustomerServiceImpl implements CommissionCustomerService {
	
	@Autowired
	private CommissionCustomerDao commissionCustomerDao;
	
	@Override
	public int saveCommissionCustomer(CommissionCustomer cc) {
		return commissionCustomerDao.saveCommissionCustomer(cc);
	}

	@Override
	public List<CommissionCustomer> getAllComCusListByParams(
			CommissionCustomer cc, int pageNo, int pageSize) {
		
		cc.setStartsize((pageNo-1)*pageSize);
		cc.setEndsize(pageSize);
		List<CommissionCustomer> list = commissionCustomerDao.getAllComCusListByParams(cc);
		return list;
	}

	@Override
	public int updateCCinfo(CommissionCustomer cc) {
		return commissionCustomerDao.updateCCinfo(cc);
	}

}
